import  {Redirect} from 'umi'

export default (props)=>{
    var token=localStorage.getItem('token')
    if(props.location.pathname==='/'){
        if(token){
            return <Redirect to='/home/goodslist' />
        }
    }else{
        if(!token){
            return <Redirect to='/' />
        }
    }
    return (<>{props.children}</>)
}